/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yinshi.j2d.geom;

import java.awt.Paint;
import java.awt.Stroke;
import java.awt.geom.Rectangle2D;
import yinshi.j2d.Shape2D;
import yinshi.j2d.TransformGroup;

/**
 *
 * @author yinshi
 */
public class Rectangle extends TransformGroup {

    private Shape2D shape = new Shape2D();

    public Rectangle(int width, int height) {

        shape.setShape(new Rectangle2D.Double(-width / 2, -height / 2, width, height));
        this.add(shape);
    }

    public Paint getForeground() {
        return shape.getForeground();
    }

    public void setForeground(Paint foreground) {
        shape.setForeground(foreground);
    }

    public Paint getBackground() {
        return shape.getBackground();
    }

    public void setBackground(Paint background) {
        shape.setBackground(background);
    }

    public Stroke getStroke() {
        return shape.getStroke();
    }

    public void setStroke(Stroke stroke) {
        shape.setStroke(stroke);
    }
}
